package com.yl.auth.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author
 * @since 2023-06-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "部门实体类")
public class Bumen implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 部门名称
     */
    private String name;

    /**
     * 部门父id
     */
    private Long pid;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 创建人姓名
     */
    @TableField(exist = false)
    private String cname;

    /**
     * 修改时间
     */
    private LocalDateTime updateTime;

    /**
     * 修改人姓名
     */
    @TableField(exist = false)
    private String uname;

    /**
     * 备注
     */
    private String remark;


    @TableField(exist = false)
    private Long value;
    @TableField(exist = false)
    private String label;
    public Bumen buildCas(){
        this.setValue(this.getId());
        this.setLabel(this.getName());
        return this;
    }
}
